// #include
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>

int main() {
  int fd = open("/dev/stdout", O_WRONLY | O_CREAT);
  const char *cr = "asdfasfasdfasdasfdad\n";

  size_t size = strlen(cr);

  void *buf = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE,
                   MAP_ANON | MAP_SHARED, 0, 0);
  if (!buf) {
    return 1;
  }

  printf("addr: 0x%lx, size: %zu\n", (unsigned long)buf, sizeof(buf));
  memcpy(buf, cr, size);
  write(fd, buf, size);
  close(fd);
}
